package com.aspose.cells;

class zbkv extends zck {
   zbkv(zn var1, float var2, float var3, zbkr var4) {
      super(var1, var2, var3, var4);
   }

   com.aspose.cells.b.a.b.a.ze a(com.aspose.cells.b.a.b.zq var1) {
      float var2 = 0.0F;
      float var3 = 0.0F;
      float var4 = 0.0F;
      com.aspose.cells.b.a.b.zo[] var5 = new com.aspose.cells.b.a.b.zo[6];
      com.aspose.cells.b.a.b.a.ze var6 = new com.aspose.cells.b.a.b.a.ze();
      com.aspose.cells.b.a.b.zt var7;
      com.aspose.cells.b.a.b.zq var8;
      if (this.e.m != null) {
         if (this.e.m.a.size() > 0) {
            var2 = Math.min(var1.h(), var1.i()) * com.aspose.cells.b.a.ze.a(this.e.m.a.get(0)) / 100000.0F;
            var3 = Math.min(var1.h(), var1.i()) * com.aspose.cells.b.a.ze.a(this.e.m.a.get(1)) / 100000.0F;
         } else {
            var2 = 0.0F;
            var3 = 0.0F;
         }

         var4 = var2 * 2.0F;
         var7 = new com.aspose.cells.b.a.b.zt(var4, var4);
         var8 = new com.aspose.cells.b.a.b.zq(var1.d(), var7);
         if (var2 != 0.0F && var3 != 0.0F) {
            switch(this.e.b) {
            case 1:
               var5[0] = new com.aspose.cells.b.a.b.zo(var2 + var1.f(), var1.g());
               var5[1] = new com.aspose.cells.b.a.b.zo(var1.l() - var3, var1.g());
               var5[2] = new com.aspose.cells.b.a.b.zo(var1.l(), var3 + var1.g());
               var5[3] = new com.aspose.cells.b.a.b.zo(var1.l(), var1.m());
               var5[4] = new com.aspose.cells.b.a.b.zo(var1.f(), var1.m());
               var5[5] = new com.aspose.cells.b.a.b.zo(var1.f(), var2 + var1.g());
               var6.a(var8, 180.0F, 90.0F);
               var6.a(var5[1], var5[2]);
               var6.a(var5[2], var5[3]);
               var6.a(var5[3], var5[4]);
               break;
            case 2:
               var5[0] = new com.aspose.cells.b.a.b.zo(var1.f(), var1.g());
               var5[1] = new com.aspose.cells.b.a.b.zo(var1.l(), var1.g());
               var5[2] = new com.aspose.cells.b.a.b.zo(var1.l(), var1.m() - var3);
               var5[3] = new com.aspose.cells.b.a.b.zo(var1.l() - var3, var1.m());
               var5[4] = new com.aspose.cells.b.a.b.zo(var2 + var1.f(), var1.m());
               var5[5] = new com.aspose.cells.b.a.b.zo(var1.f(), var1.m() - var2);
               var6.a(var5[0], var5[1]);
               var6.a(var5[1], var5[2]);
               var6.a(var5[2], var5[3]);
               var8.b(var1.m() - var4);
               var6.a(var8, 90.0F, 90.0F);
               break;
            case 3:
               var5[0] = new com.aspose.cells.b.a.b.zo(var1.f(), var1.g());
               var5[1] = new com.aspose.cells.b.a.b.zo(var1.l(), var1.g());
               var5[2] = new com.aspose.cells.b.a.b.zo(var1.l(), var1.m() - var2);
               var5[3] = new com.aspose.cells.b.a.b.zo(var1.l() - var2, var1.m());
               var5[4] = new com.aspose.cells.b.a.b.zo(var3 + var1.f(), var1.m());
               var5[5] = new com.aspose.cells.b.a.b.zo(var1.f(), var1.m() - var3);
               var6.a(var5[0], var5[1]);
               var8.a(var1.l() - var4);
               var8.b(var1.m() - var4);
               var6.a(var8, 0.0F, 90.0F);
               var6.a(var5[4], var5[5]);
               var6.a(var5[5], var5[0]);
               break;
            case 4:
               var5[0] = new com.aspose.cells.b.a.b.zo(var3 + var1.f(), var1.g());
               var5[1] = new com.aspose.cells.b.a.b.zo(var1.l() - var2, var1.g());
               var5[2] = new com.aspose.cells.b.a.b.zo(var1.l(), var2);
               var5[3] = new com.aspose.cells.b.a.b.zo(var1.l(), var1.m());
               var5[4] = new com.aspose.cells.b.a.b.zo(var1.f(), var1.m());
               var5[5] = new com.aspose.cells.b.a.b.zo(var1.f(), var3 + var1.g());
               var8.a(var1.l() - var4);
               var6.a(var8, 270.0F, 90.0F);
               var6.a(var5[3], var5[4]);
               var6.a(var5[4], var5[5]);
               var6.a(var5[5], var5[0]);
            }
         } else if (var2 == 0.0F && var3 != 0.0F) {
            switch(this.e.b) {
            case 1:
               var5[0] = new com.aspose.cells.b.a.b.zo(var1.f(), var1.g());
               var5[1] = new com.aspose.cells.b.a.b.zo(var1.l() - var3, var1.g());
               var5[2] = new com.aspose.cells.b.a.b.zo(var1.l(), var3 + var1.g());
               var5[3] = new com.aspose.cells.b.a.b.zo(var1.l(), var1.m());
               var5[4] = new com.aspose.cells.b.a.b.zo(var1.f(), var1.m());
               break;
            case 2:
               var5[0] = new com.aspose.cells.b.a.b.zo(var1.f(), var1.g());
               var5[1] = new com.aspose.cells.b.a.b.zo(var1.l(), var1.g());
               var5[2] = new com.aspose.cells.b.a.b.zo(var1.l(), var1.m() - var3);
               var5[3] = new com.aspose.cells.b.a.b.zo(var1.l() - var3, var1.m());
               var5[4] = new com.aspose.cells.b.a.b.zo(var1.f(), var1.m());
               break;
            case 3:
               var5[0] = new com.aspose.cells.b.a.b.zo(var1.f(), var1.g());
               var5[1] = new com.aspose.cells.b.a.b.zo(var1.l(), var1.g());
               var5[2] = new com.aspose.cells.b.a.b.zo(var1.l(), var1.m());
               var5[3] = new com.aspose.cells.b.a.b.zo(var3 + var1.f(), var1.m());
               var5[4] = new com.aspose.cells.b.a.b.zo(var1.f(), var1.m() - var3);
               break;
            case 4:
               var5[0] = new com.aspose.cells.b.a.b.zo(var3 + var1.f(), var1.g());
               var5[1] = new com.aspose.cells.b.a.b.zo(var1.l(), var1.g());
               var5[2] = new com.aspose.cells.b.a.b.zo(var1.l(), var1.m());
               var5[3] = new com.aspose.cells.b.a.b.zo(var1.f(), var1.m());
               var5[4] = new com.aspose.cells.b.a.b.zo(var1.f(), var3 + var1.g());
            }

            var6.a(var5[0], var5[1]);
            var6.a(var5[1], var5[2]);
            var6.a(var5[2], var5[3]);
            var6.a(var5[3], var5[4]);
            var6.a(var5[4], var5[0]);
         } else if (var2 != 0.0F && var3 == 0.0F) {
            switch(this.e.b) {
            case 1:
               var5[0] = new com.aspose.cells.b.a.b.zo(var2 + var1.f(), var1.g());
               var5[1] = new com.aspose.cells.b.a.b.zo(var1.l(), var1.g());
               var5[2] = new com.aspose.cells.b.a.b.zo(var1.l(), var1.m());
               var5[3] = new com.aspose.cells.b.a.b.zo(var1.f(), var1.m());
               var5[4] = new com.aspose.cells.b.a.b.zo(var1.f(), var2 + var1.g());
               var6.a(var8, 180.0F, 90.0F);
               var6.a(var5[1], var5[2]);
               var6.a(var5[2], var5[3]);
               break;
            case 2:
               var5[0] = new com.aspose.cells.b.a.b.zo(var1.f(), var1.g());
               var5[1] = new com.aspose.cells.b.a.b.zo(var1.l(), var1.g());
               var5[2] = new com.aspose.cells.b.a.b.zo(var1.l(), var1.m());
               var5[3] = new com.aspose.cells.b.a.b.zo(var2 + var1.f(), var1.m());
               var5[4] = new com.aspose.cells.b.a.b.zo(var1.f(), var1.m() - var2);
               var6.a(var5[0], var5[1]);
               var6.a(var5[1], var5[2]);
               var8.b(var1.m() - var4);
               var6.a(var8, 90.0F, 90.0F);
               break;
            case 3:
               var5[0] = new com.aspose.cells.b.a.b.zo(var1.f(), var1.g());
               var5[1] = new com.aspose.cells.b.a.b.zo(var1.l(), var1.g());
               var5[2] = new com.aspose.cells.b.a.b.zo(var1.l(), var1.m() - var2);
               var5[3] = new com.aspose.cells.b.a.b.zo(var1.l() - var2, var1.m());
               var5[4] = new com.aspose.cells.b.a.b.zo(var1.f(), var1.m());
               var6.a(var5[0], var5[1]);
               var8.a(var1.l() - var4);
               var8.b(var1.m() - var4);
               var6.a(var8, 0.0F, 90.0F);
               var6.a(var5[3], var5[4]);
               break;
            case 4:
               var5[0] = new com.aspose.cells.b.a.b.zo(var1.f(), var1.g());
               var5[1] = new com.aspose.cells.b.a.b.zo(var1.l() - var2, var1.g());
               var5[2] = new com.aspose.cells.b.a.b.zo(var1.l(), var2 + var1.g());
               var5[3] = new com.aspose.cells.b.a.b.zo(var1.l(), var1.m());
               var5[4] = new com.aspose.cells.b.a.b.zo(var1.f(), var1.m());
               var8.a(var1.l() - var4);
               var6.a(var8, 270.0F, 90.0F);
               var6.a(var5[3], var5[4]);
               var6.a(var5[4], var5[0]);
            }
         } else {
            var6.b(var1);
         }
      } else {
         var2 = Math.min(var1.h(), var1.i()) * 0.16F;
         var3 = Math.min(var1.h(), var1.i()) * 0.16F;
         var4 = var2 * 2.0F;
         var7 = new com.aspose.cells.b.a.b.zt(var4, var4);
         var8 = new com.aspose.cells.b.a.b.zq(var1.d(), var7);
         switch(this.e.b) {
         case 1:
            var5[0] = new com.aspose.cells.b.a.b.zo(var2 + var1.f(), var1.g());
            var5[1] = new com.aspose.cells.b.a.b.zo(var1.l() - var3, var1.g());
            var5[2] = new com.aspose.cells.b.a.b.zo(var1.l(), var3 + var1.g());
            var5[3] = new com.aspose.cells.b.a.b.zo(var1.l(), var1.m());
            var5[4] = new com.aspose.cells.b.a.b.zo(var1.f(), var1.m());
            var5[5] = new com.aspose.cells.b.a.b.zo(var1.f(), var2 + var1.g());
            var6.a(var8, 180.0F, 90.0F);
            var6.a(var5[1], var5[2]);
            var6.a(var5[2], var5[3]);
            var6.a(var5[3], var5[4]);
            break;
         case 2:
            var5[0] = new com.aspose.cells.b.a.b.zo(var1.f(), var1.g());
            var5[1] = new com.aspose.cells.b.a.b.zo(var1.l(), var1.g());
            var5[2] = new com.aspose.cells.b.a.b.zo(var1.l(), var1.m() - var3);
            var5[3] = new com.aspose.cells.b.a.b.zo(var1.l() - var3, var1.m());
            var5[4] = new com.aspose.cells.b.a.b.zo(var2 + var1.f(), var1.m());
            var5[5] = new com.aspose.cells.b.a.b.zo(var1.f(), var1.m() - var2);
            var6.a(var5[0], var5[1]);
            var6.a(var5[1], var5[2]);
            var6.a(var5[2], var5[3]);
            var8.b(var1.m() - var4);
            var6.a(var8, 90.0F, 90.0F);
            break;
         case 3:
            var5[0] = new com.aspose.cells.b.a.b.zo(var1.f(), var1.g());
            var5[1] = new com.aspose.cells.b.a.b.zo(var1.l(), var1.g());
            var5[2] = new com.aspose.cells.b.a.b.zo(var1.l(), var1.m() - var2);
            var5[3] = new com.aspose.cells.b.a.b.zo(var1.l() - var2, var1.m());
            var5[4] = new com.aspose.cells.b.a.b.zo(var3 + var1.f(), var1.m());
            var5[5] = new com.aspose.cells.b.a.b.zo(var1.f(), var1.m() - var3);
            var6.a(var5[0], var5[1]);
            var8.a(var1.l() - var4);
            var8.b(var1.m() - var4);
            var6.a(var8, 0.0F, 90.0F);
            var6.a(var5[4], var5[5]);
            var6.a(var5[5], var5[0]);
            break;
         case 4:
            var5[0] = new com.aspose.cells.b.a.b.zo(var3 + var1.f(), var1.g());
            var5[1] = new com.aspose.cells.b.a.b.zo(var1.l() - var2, var1.g());
            var5[2] = new com.aspose.cells.b.a.b.zo(var1.l(), var2 + var1.g());
            var5[3] = new com.aspose.cells.b.a.b.zo(var1.l(), var1.m());
            var5[4] = new com.aspose.cells.b.a.b.zo(var1.f(), var1.m());
            var5[5] = new com.aspose.cells.b.a.b.zo(var1.f(), var3 + var1.g());
            var8.a(var1.l() - var4);
            var6.a(var8, 270.0F, 90.0F);
            var6.a(var5[3], var5[4]);
            var6.a(var5[4], var5[5]);
            var6.a(var5[5], var5[0]);
         }
      }

      var6.i();
      return var6;
   }

   void a() {
      com.aspose.cells.b.a.b.zq var1 = this.d(this.e.v());
      super.c(var1);
   }

   private com.aspose.cells.b.a.b.zq d(com.aspose.cells.b.a.b.zq var1) {
      float var2 = 0.0F;
      float var3 = 0.0F;
      if (this.e.m != null) {
         if (this.e.m.a.size() > 0) {
            var2 = Math.min(var1.h(), var1.i()) * com.aspose.cells.b.a.ze.a(this.e.m.a.get(0)) / 100000.0F;
            var3 = Math.min(var1.h(), var1.i()) * com.aspose.cells.b.a.ze.a(this.e.m.a.get(1)) / 100000.0F;
         } else {
            var2 = 0.0F;
            var3 = 0.0F;
         }
      } else {
         var2 = Math.min(var1.h(), var1.i()) * 0.16F;
         var3 = Math.min(var1.h(), var1.i()) * 0.16F;
      }

      if (var2 <= 0.0F && var3 <= 0.0F) {
         return var1;
      } else {
         com.aspose.cells.b.a.b.zq var4 = new com.aspose.cells.b.a.b.zq(var1.f(), var1.g(), var1.h(), var1.i());
         float var5 = var2 / 3.0F;
         float var6 = var3 / 2.0F;
         float var7 = 0.0F;
         float var8 = 0.0F;
         float var9 = 0.0F;
         float var10 = 0.0F;
         switch(this.e.b) {
         case 1:
            var8 = var5 > var6 ? var5 : var6;
            var9 = var5;
            var7 = var6;
            break;
         case 2:
            var9 = var5;
            var10 = var5 > var6 ? var5 : var6;
            var7 = var6;
            break;
         case 3:
            var7 = var5;
            var10 = var5 > var6 ? var5 : var6;
            var9 = var6;
            break;
         case 4:
            var8 = var5 > var6 ? var5 : var6;
            var7 = var5;
            var9 = var6;
         }

         var4.a(var4.f() + var7);
         var4.c(var4.h() - var7);
         var4.c(var4.h() - var9);
         var4.b(var4.g() + var8);
         var4.d(var4.i() - var8);
         var4.d(var4.i() - var10);
         return var4;
      }
   }
}
